<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateAkbusAccidentInjuredTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('akbus_accident_injured', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('name')->nullable()->comment('姓名');
            $table->integer('age')->nullable()->comment('年龄');
            $table->decimal('medical_cost')->nullable()->comment('医疗费用');
            $table->decimal('other_cost')->nullable()->comment('非他费用');
            $table->integer('hospital_days')->nullable()->comment('住院天数');
            $table->integer('nursing_days')->nullable()->comment('护理天数');
            $table->decimal('nursing_cost')->nullable()->comment('护理费用');
            $table->integer('bed_days')->nullable()->comment('挂床天数');
            $table->decimal('refund')->nullable()->comment('退费');
            $table->decimal('compensation_cost')->nullable()->comment('赔偿费用');
            $table->string('remark')->nullable()->comment('备注');
            $table->unsignedBigInteger('accident_id')->comment('事故ID');
            $table->foreign('accident_id')->references('id')->on('akbus_accident')->onDelete('cascade');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('akbus_accident_injured');
    }
}
